#ifndef YHAIDA_RPCCODEC_H
#define YHAIDA_RPCCODEC_H
#include "../../server/datetime/Timestamp.h"
#include "../../server/logging/Logging.h"
#include "../protobuf/ProtobufCodecLite.h"
#include "../../server/net/TcpConnection.h"
// #include "./rpc.pb.h"

namespace yhaida
{
    namespace rpc
    {
        // class Buffer;
        // class TcpConnection;

        typedef std::shared_ptr<yhaida::TcpConnection> TcpConnectionPtr;
        
        class RpcMessage;
        typedef std::shared_ptr<RpcMessage> RpcMessagePtr;

        extern const char rpctag[]; // = "RPC0";

        /**
         * @brief
         * 
         * Field     Length  Content
         * size      4-byte  N+8
         * "RPC0"    4-byte
         * payload   N-byte
         * checksum  4-byte  adler32 of "RPC0"+payload
         *
         */
        typedef yhaida::ProtobufCodecLiteT<RpcMessage,rpctag> RpcCodec;
    }
}

#endif